#ifndef CLASSLEVEL_H
#define CLASSLEVEL_H


#include "dtwenty_global.h"
#include "dtwentyitem.h"
#include "dtwentyitemcontainer.h"
#include "specialability.h"


class CharacterClass;


class DTWENTYSHARED_EXPORT ClassLevel : public SpecialAbilities
{
    Q_OBJECT

    Q_PROPERTY(QVariant baseAttackValue READ baseAttackValue)
    Q_PROPERTY(QVariant fortSaveValue READ fortSaveValue)
    Q_PROPERTY(QVariant refSaveValue READ refSaveValue)
    Q_PROPERTY(QVariant willSaveValue READ willSaveValue)
    Q_PROPERTY(QString specialAbilities READ specialAbilities)



public:

    Q_INVOKABLE ClassLevel(DTwentyItem *parent = 0);
    ClassLevel(const ClassLevel& other);

    virtual bool removable() const;

    virtual int type() const;
    int level() const;

    QVariant baseAttackValue() const;
    QVariant fortSaveValue() const;
    QVariant refSaveValue() const;
    QVariant willSaveValue() const;
    QString specialAbilities() const;

    virtual QVariant sortData() const;


protected slots:

    virtual void onInitChildren();


protected:

    CharacterClass* characterClass() const;


};


Q_DECLARE_METATYPE(ClassLevel)


class DTWENTYSHARED_EXPORT ClassLevels : public DTwentyItemContainer
{
    Q_OBJECT

    Q_PROPERTY(QVariant baseAttackTitle READ baseAttackTitle)
    Q_PROPERTY(QVariant fortSaveTitle READ fortSaveTitle)
    Q_PROPERTY(QVariant refSaveTitle READ refSaveTitle)
    Q_PROPERTY(QVariant willSaveTitle READ willSaveTitle)
    Q_PROPERTY(QString specialAbilitiesTitle READ specialAbilitiesTitle)


public:

    Q_INVOKABLE ClassLevels(QObject* parent = 0) :
        DTwentyItemContainer(parent)
    {
        registerChildType<ClassLevel>();
    }

    ClassLevels(const ClassLevels& other) :
        DTwentyItemContainer(other)
    {
    }

    virtual int type() const
    {
        return qMetaTypeId<ClassLevels*>();
    }

    QVariant baseAttackTitle() const
    {
        return tr("BA", "Acronym for Base Attack");
    }
    QVariant fortSaveTitle() const
    {
        return tr("Fort", "Acronym for Fortitude");
    }
    QVariant refSaveTitle() const
    {
        return tr("Ref", "Acronym for Reflex");
    }
    QVariant willSaveTitle() const
    {
        return tr("Will", "Acronym for Willpower");
    }
    QString specialAbilitiesTitle() const
    {
        return tr("Special");
    }
};

Q_DECLARE_METATYPE(ClassLevels)


#endif // CLASSLEVEL_H
